//明星老师
var myChart1 = echarts.init(document.getElementById('popTeacher'));
option = {
    title: {
        text: '明星老师',
        subtext: '同比百分比(%)',
        textStyle: {
            fontWeight: 'normal',              //标题颜色
            color: '#f8fcf7'
        },

    },
    backgroundColor: 'transparent',
    visualMap: {
        show: false,
        min: 80,
        max: 600,
        inRange: {
            colorLightness: [0, 1]
        }
    },
    series: [
        {
            name: '访问来源',
            type: 'pie',
            radius: '55%',
            data: [
                {value: 310, name: '曾老师'},
                {value: 335, name: '许老师'},
                {value: 400, name: '高老师'},
                {value: 435, name: '邓老师'},
                {value: 450, name: '王老师'},
                {value: 470, name: '熊老师'},
                {value: 500, name: '廖老师'},
            ],
            roseType: 'angle',
            label: {
                normal: {
                    textStyle: {
                        color: 'rgba(255, 255, 255, 0.3)'
                    }
                }
            },
            labelLine: {
                normal: {
                    lineStyle: {
                        color: 'rgba(255, 255, 255, 0.3)'
                    }
                }
            },
            itemStyle: {
                normal: {
                    color: 'pink',
                    shadowBlur: 200,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};
myChart1.setOption(option);

var myChart2 = echarts.init(document.getElementById('starCalss'));

// 指定图表的配置项和数据
var option2 = {
    title: {
        text: '明星班级',
        subtext: '投票数',
        textStyle: {
            fontWeight: 'normal',              //标题颜色
            color: '#f8fcf7'
        },
    },
    tooltip: {},
    legend: {
        data: ['票数'],
        textStyle: {
            color: '#ebeef1',
        },
        itemStyle: {
            color:'navy'
        }
    },
    xAxis: {
        data: ["新苗班", "丫丫班", "兔兔班", "飞飞班", "杰杰班", "晶晶班", "熊熊班"],
        axisLine: {
            lineStyle: {
                color: '#ebeef1',
                width: 1,//这里是为了突出显示加上的
            },
            textStyle: {
                color: '#ebeef1',
            }
        }
    },
    yAxis: {
        axisLine: {
            lineStyle: {
                color: '#ebeef1',
                width: 1,//这里是为了突出显示加上的
            },
            textStyle: {
                color: '#ebeef1',
            }
        }

    },
    series: [{
        name: '票数',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20, 35, 40],
        itemStyle: {
            normal: {
                //这里是重点
                color: function (params) {
                    //注意，如果颜色太少的话，后面颜色不会自动循环，最好多定义几个颜色
                    var colorList = ['pink', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622'];
                    return colorList[params.dataIndex]
                }
            }
        },
        lineStyle: {
            textStyle: {
                color: 'rgb(238,232,232)'
            }
        }
    }],
};

// 使用刚指定的配置项和数据显示图表。
myChart2.setOption(option2);









//循环读取假数据渲染页面
function xuanran() {
    let msgBoxNode = document.getElementsByClassName('msgBox')[0];
    for (let k=0;k<BulletinList.length-1;k++){
        let cloneNode = msgBoxNode.cloneNode(true);
        console.log(cloneNode);
        msgBoxNode.parentNode.appendChild(cloneNode);
    }
    console.log(document.getElementsByClassName('msgBox'));
    let theMsgBox = document.getElementsByClassName('msgBox');
    for (let k=0;k<BulletinList.length;k++){
         let timeSpan = document.getElementsByClassName('time')[k];
         let AuthorSpan = document.getElementsByClassName('Author')[k];
        let newsTitleSpan = document.getElementsByClassName('newsTitle')[k];
        let newsContentSpan = document.getElementsByClassName('newsContent')[k];
         timeSpan.innerText = BulletinList[k].Time;
         AuthorSpan.innerText = BulletinList[k].Author;
         newsTitleSpan.innerHTML = BulletinList[k].Title;
        newsContentSpan.innerText = BulletinList[k].Content;
    }
    console.log(document.getElementsByClassName('time'));
}
//分割线长度
console.log($('.box').outerHeight());
// console.log(($('.msg-right')[4]).clientHeight);
$('.Hline').css({
    'height' : 1770+'px'
})